<!DOCTYPE html>
<html 
<head >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css"  media="all"/>
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/loader.css" media="all"/>
<link rel="stylesheet"  href="../../../css/common/tablepage.css" media="all"/>
</head>
<body>
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-form layui-card-header layuiadmin-card-header-auto" id="searchForm">
			   <div class="layui-form-item">

                 <div class="layui-inline">
				  <label class="layui-form-label">apk名称</label>
				  <div class="layui-input-block">
				  <input type="text" name="apkName" disabled=true  autocomplete="off" class="layui-input">
				   </div>
				 </div>

               <div class="layui-inline">
				  <label class="layui-form-label">版本号</label>
				  <div class="layui-input-block">
				  <input type="text" name="versionNum" placeholder="请输入" autocomplete="off" class="layui-input">
				   </div>
				 </div>

                 <div class="layui-inline">
				  <label class="layui-form-label">版本名称</label>
				  <div class="layui-input-block">
				  <input type="text" name="versionName" placeholder="请输入" autocomplete="off" class="layui-input">
				   </div>
				 </div>
                 <div class="layui-inline">
				  <label class="layui-form-label">apk类型</label>
				  <div class="layui-input-block">
				  <select name="apkType"  style="width:250px"  lay-select-dict="apk_type" >
				  </select>
				   </div>
				 </div>

                 

            
				 <div class="layui-inline">
				  <button class="layui-btn layuiadmin-btn-sm" lay-submit
							lay-filter="searchSubmit"  >查询</button>
				</div>
				</div>
			</div>
			<div class="layui-card-body">
				<table id="dataList" lay-filter="dataList" ></table>
				
	
			</div>
		</div>
	</div>
<div type="text/html" id="trTool" style="display:none">
    <a  data-grant="system:apkVersion:edit" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
    <a  data-grant="system:apkVersion:download" class="layui-btn layui-btn-success layui-btn-xs" lay-event="download"><i class="layui-icon layui-icon-download-circle"></i>下载</a>
    <a  data-grant="system:apkVersion:remove" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
</div>

<div type="text/html" id="toolbar" style="display:none" >
<div class="layui-btn-container">
     <button data-grant="system:apkVersion:add"   class="layui-btn layui-btn-sm" lay-event="add"> <i class="layui-icon layui-icon-add-1"></i>新增</button>
</div>
</div>
<script type="text/html" id="qrcodeBar">
  <a  lay-event="qrcode" title="二维码下载"><img src="../../../img/qrcode.png" ></a>

</script>
<script   src="../../../layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="../../../lib/jQuery-2.2.0.min.js" ></script>
	<script>
		layui.config({
			base :  '../../../layuiadmin/' //静态资源所在路径
		}).extend({
			webplus : 'lib/webplus'//主入口模块
			
		}).use([ 'table','form','webplus' ], function() {
			var $ = layui.$,
			webplus=layui.webplus,
			form = layui.form,
			table = layui.table;
		   var cols= [ [ {
				type : 'numbers',
				title : '序号'
			}, {
				
				title : '二维码',
				width : 75,
				align :'center',
				toolbar: '#qrcodeBar'
			}, {
				field : 'versionId',
				title : '编号',
				hide : true 
			},
            {
			 field : 'apkName',
			 title : 'apk名称',
			 width:180
			},
            {
			 field : 'fid',
			 title : '文件fid',
			 hide:true
			},
			{
				 field : 'versionNum',
				 title : '版本号',
				 width:80
		   },
            {
			 field : 'versionName',
			 title : '版本名称',
			 width:110
			},
            
            {
			 field : 'versionDesc',
			 title : '升级说明',
			 minWidth:150
			},
            {
			 field : 'releaseStatus_dict',
			 title : '强制升级',
			 width:90
			},
			 {
				 field : 'apkType_dict',
				 title : '版本类型',
				 width:90
			 },
            {
			 field : 'createTime',
			 title : '发布时间',
			 width:170
			},
          
           {

				title : '操作',
				toolbar : '#trTool',
				fixed: 'right',
				width :220
			} ] ];
		   webplus.init('buss/apkVersion/list',cols)
			 //监听行工具事件
			  table.on('tool(dataList)', function(rowObj){
			    switch(rowObj.event){
			    	case 'edit':
			    		webplus.openEditWindow('editApkVersion.html','编辑',rowObj,'versionId','','500','500');
			       		
			   			break;
			    	case 'qrcode':
			    		webplus.openDetailWindow('showDownloadQrcode.html','二维码下载',rowObj,'versionId','','600','440');
			    	    break;
			    	case 'download':
			    		window.location.href=webplus.cxt()+"/file/downloadApk?fid="+rowObj.data.fid;
			    	    break;
			    	case 'del':
				    	
				        webplus.removeRow('buss/apkVersion/remove',rowObj,'versionId');
			    		break;
			    }
			  });
			 //监听表头按钮事件
			  table.on('toolbar(dataList)', function(obj){
			    switch(obj.event){
			      	case 'add':
				         //打开添加弹出框
				         webplus.openWindow('addApkVersion.html','新增','500','500');
			     	     break;
			    }
			  });

		});
	</script>

</body>
</html>